<template>
	<el-form ref="dataFormRef" :model="form.customerInfo" formDialogRef label-width="90px">
		<el-row :gutter="24">
			<el-col :span="12" class="mb20">
				<el-form-item label="姓名" prop="name">
					<el-input v-model="form.customerInfo.name" disabled />
				</el-form-item>
			</el-col>

			<el-col :span="12" class="mb20">
				<el-form-item label="性别" prop="sex">
					<el-radio-group v-model="form.customerInfo.sex" disabled>
						<el-radio :label="item.value" v-for="(item, index) in gender" border :key="index">{{ item.label }} </el-radio>
					</el-radio-group>
				</el-form-item>
			</el-col>

			<el-col :span="12" class="mb20">
				<el-form-item label="年龄" prop="age">
					<el-input-number v-model="form.customerInfo.age" disabled />
				</el-form-item>
			</el-col>

			<el-col :span="12" class="mb20">
				<el-form-item label="村" prop="village">
					<!--          <el-input v-model="form.customerInfo.village" disabled/>-->
					{{ form.customerInfo.villageName }}
					<!-- <el-select v-model="form.customerInfo.village" placeholder="请输入村" disabled>
            <el-option :label="item.label" :value="item.value" v-for="(item, index) in village" :key="index"/>
          </el-select> -->
				</el-form-item>
			</el-col>

			<el-col :span="12" class="mb20">
				<el-form-item label="社保卡号" prop="medicalCard">
					<el-input v-model="form.customerInfo.medicalCard" disabled />
				</el-form-item>
			</el-col>

			<el-col :span="12" class="mb20">
				<el-form-item label="身份证号" prop="icCard">
					<el-input v-model="form.customerInfo.icCard" disabled />
				</el-form-item>
			</el-col>
		</el-row>
	</el-form>
</template>

<script setup lang="ts" name="CustomerInfo">
import { useDict } from '/@/hooks/dict';

// 定义变量内容
const dataFormRef = ref();

const { gender, village } = useDict('gender', 'village');

// 接收组件传输的接收表单
const form = defineProps({
	customerInfo: Object,
});

const openDialog = (row: any) => {
	Object.assign(form, row);
};

// 暴露变量
defineExpose({
	openDialog,
});
</script>

<style scoped>
:deep(.el-input.is-disabled .el-input__inner) {
	color: var(--el-input-text-color, var(--el-text-color-regular));
	-webkit-text-fill-color: var(--el-input-text-color, var(--el-text-color-regular));
}
</style>
